Termination w.r.t. Q of the following Term Rewriting System could be proven:

Q restricted rewrite system:
The TRS R consists of the following rules:

a(a(divides, 0), a(s, y)) → true
a(a(divides, a(s, x)), a(s, y)) → a(a(a(div2, x), a(s, y)), y)
a(a(a(div2, x), y), 0) → a(a(divides, x), y)
a(a(a(div2, 0), y), a(s, z)) → false
a(a(a(div2, a(s, x)), y), a(s, z)) → a(a(a(div2, x), y), z)
a(a(filter, f), nil) → nil
a(a(filter, f), a(a(cons, x), xs)) → a(a(a(if, a(f, x)), x), a(a(filter, f), xs))
a(a(a(if, true), x), xs) → a(a(cons, x), xs)
a(a(a(if, false), x), xs) → xs
a(a(not, f), x) → a(not2, a(f, x))
a(not2, true) → false
a(not2, false) → true
a(sieve, nil) → nil
a(sieve, a(a(cons, x), xs)) → a(a(cons, x), a(sieve, a(a(filter, a(not, a(divides, x))), xs)))

Q is empty.


QTRS
  ↳ Overlay + Local Confluence

Q restricted rewrite system:
The TRS R consists of the following rules:

a(a(divides, 0), a(s, y)) → true
a(a(divides, a(s, x)), a(s, y)) → a(a(a(div2, x), a(s, y)), y)
a(a(a(div2, x), y), 0) → a(a(divides, x), y)
a(a(a(div2, 0), y), a(s, z)) → false
a(a(a(div2, a(s, x)), y), a(s, z)) → a(a(a(div2, x), y), z)
a(a(filter, f), nil) → nil
a(a(filter, f), a(a(cons, x), xs)) → a(a(a(if, a(f, x)), x), a(a(filter, f), xs))
a(a(a(if, true), x), xs) → a(a(cons, x), xs)
a(a(a(if, false), x), xs) → xs
a(a(not, f), x) → a(not2, a(f, x))
a(not2, true) → false
a(not2, false) → true
a(sieve, nil) → nil
a(sieve, a(a(cons, x), xs)) → a(a(cons, x), a(sieve, a(a(filter, a(not, a(divides, x))), xs)))

Q is empty.

The TRS is overlay and locally confluent. By [19] we can switch to innermost.

↳ QTRS
  ↳ Overlay + Local Confluence
QTRS
      ↳ DependencyPairsProof

Q restricted rewrite system:
The TRS R consists of the following rules:

a(a(divides, 0), a(s, y)) → true
a(a(divides, a(s, x)), a(s, y)) → a(a(a(div2, x), a(s, y)), y)
a(a(a(div2, x), y), 0) → a(a(divides, x), y)
a(a(a(div2, 0), y), a(s, z)) → false
a(a(a(div2, a(s, x)), y), a(s, z)) → a(a(a(div2, x), y), z)
a(a(filter, f), nil) → nil
a(a(filter, f), a(a(cons, x), xs)) → a(a(a(if, a(f, x)), x), a(a(filter, f), xs))
a(a(a(if, true), x), xs) → a(a(cons, x), xs)
a(a(a(if, false), x), xs) → xs
a(a(not, f), x) → a(not2, a(f, x))
a(not2, true) → false
a(not2, false) → true
a(sieve, nil) → nil
a(sieve, a(a(cons, x), xs)) → a(a(cons, x), a(sieve, a(a(filter, a(not, a(divides, x))), xs)))

The set Q consists of the following terms:

a(a(divides, 0), a(s, x0))
a(a(divides, a(s, x0)), a(s, x1))
a(a(a(div2, x0), x1), 0)
a(a(a(div2, 0), x0), a(s, x1))
a(a(a(div2, a(s, x0)), x1), a(s, x2))
a(a(filter, x0), nil)
a(a(filter, x0), a(a(cons, x1), x2))
a(a(a(if, true), x0), x1)
a(a(a(if, false), x0), x1)
a(a(not, x0), x1)
a(not2, true)
a(not2, false)
a(sieve, nil)
a(sieve, a(a(cons, x0), x1))


Using Dependency Pairs [1,15] we result in the following initial DP problem:
Q DP problem:
The TRS P consists of the following rules:

A(sieve, a(a(cons, x), xs)) → A(a(filter, a(not, a(divides, x))), xs)
A(a(a(div2, a(s, x)), y), a(s, z)) → A(div2, x)
A(a(a(div2, x), y), 0) → A(a(divides, x), y)
A(a(filter, f), a(a(cons, x), xs)) → A(a(filter, f), xs)
A(a(not, f), x) → A(not2, a(f, x))
A(a(filter, f), a(a(cons, x), xs)) → A(f, x)
A(sieve, a(a(cons, x), xs)) → A(filter, a(not, a(divides, x)))
A(sieve, a(a(cons, x), xs)) → A(sieve, a(a(filter, a(not, a(divides, x))), xs))
A(a(a(if, true), x), xs) → A(cons, x)
A(a(a(div2, a(s, x)), y), a(s, z)) → A(a(div2, x), y)
A(a(divides, a(s, x)), a(s, y)) → A(a(a(div2, x), a(s, y)), y)
A(a(a(if, true), x), xs) → A(a(cons, x), xs)
A(a(a(div2, a(s, x)), y), a(s, z)) → A(a(a(div2, x), y), z)
A(a(filter, f), a(a(cons, x), xs)) → A(a(a(if, a(f, x)), x), a(a(filter, f), xs))
A(a(a(div2, x), y), 0) → A(divides, x)
A(sieve, a(a(cons, x), xs)) → A(not, a(divides, x))
A(a(filter, f), a(a(cons, x), xs)) → A(a(if, a(f, x)), x)
A(a(divides, a(s, x)), a(s, y)) → A(div2, x)
A(sieve, a(a(cons, x), xs)) → A(divides, x)
A(a(divides, a(s, x)), a(s, y)) → A(a(div2, x), a(s, y))
A(a(not, f), x) → A(f, x)
A(sieve, a(a(cons, x), xs)) → A(a(cons, x), a(sieve, a(a(filter, a(not, a(divides, x))), xs)))
A(a(filter, f), a(a(cons, x), xs)) → A(if, a(f, x))

The TRS R consists of the following rules:

a(a(divides, 0), a(s, y)) → true
a(a(divides, a(s, x)), a(s, y)) → a(a(a(div2, x), a(s, y)), y)
a(a(a(div2, x), y), 0) → a(a(divides, x), y)
a(a(a(div2, 0), y), a(s, z)) → false
a(a(a(div2, a(s, x)), y), a(s, z)) → a(a(a(div2, x), y), z)
a(a(filter, f), nil) → nil
a(a(filter, f), a(a(cons, x), xs)) → a(a(a(if, a(f, x)), x), a(a(filter, f), xs))
a(a(a(if, true), x), xs) → a(a(cons, x), xs)
a(a(a(if, false), x), xs) → xs
a(a(not, f), x) → a(not2, a(f, x))
a(not2, true) → false
a(not2, false) → true
a(sieve, nil) → nil
a(sieve, a(a(cons, x), xs)) → a(a(cons, x), a(sieve, a(a(filter, a(not, a(divides, x))), xs)))

The set Q consists of the following terms:

a(a(divides, 0), a(s, x0))
a(a(divides, a(s, x0)), a(s, x1))
a(a(a(div2, x0), x1), 0)
a(a(a(div2, 0), x0), a(s, x1))
a(a(a(div2, a(s, x0)), x1), a(s, x2))
a(a(filter, x0), nil)
a(a(filter, x0), a(a(cons, x1), x2))
a(a(a(if, true), x0), x1)
a(a(a(if, false), x0), x1)
a(a(not, x0), x1)
a(not2, true)
a(not2, false)
a(sieve, nil)
a(sieve, a(a(cons, x0), x1))

We have to consider all minimal (P,Q,R)-chains.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
QDP
          ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

A(sieve, a(a(cons, x), xs)) → A(a(filter, a(not, a(divides, x))), xs)
A(a(a(div2, a(s, x)), y), a(s, z)) → A(div2, x)
A(a(a(div2, x), y), 0) → A(a(divides, x), y)
A(a(filter, f), a(a(cons, x), xs)) → A(a(filter, f), xs)
A(a(not, f), x) → A(not2, a(f, x))
A(a(filter, f), a(a(cons, x), xs)) → A(f, x)
A(sieve, a(a(cons, x), xs)) → A(filter, a(not, a(divides, x)))
A(sieve, a(a(cons, x), xs)) → A(sieve, a(a(filter, a(not, a(divides, x))), xs))
A(a(a(if, true), x), xs) → A(cons, x)
A(a(a(div2, a(s, x)), y), a(s, z)) → A(a(div2, x), y)
A(a(divides, a(s, x)), a(s, y)) → A(a(a(div2, x), a(s, y)), y)
A(a(a(if, true), x), xs) → A(a(cons, x), xs)
A(a(a(div2, a(s, x)), y), a(s, z)) → A(a(a(div2, x), y), z)
A(a(filter, f), a(a(cons, x), xs)) → A(a(a(if, a(f, x)), x), a(a(filter, f), xs))
A(a(a(div2, x), y), 0) → A(divides, x)
A(sieve, a(a(cons, x), xs)) → A(not, a(divides, x))
A(a(filter, f), a(a(cons, x), xs)) → A(a(if, a(f, x)), x)
A(a(divides, a(s, x)), a(s, y)) → A(div2, x)
A(sieve, a(a(cons, x), xs)) → A(divides, x)
A(a(divides, a(s, x)), a(s, y)) → A(a(div2, x), a(s, y))
A(a(not, f), x) → A(f, x)
A(sieve, a(a(cons, x), xs)) → A(a(cons, x), a(sieve, a(a(filter, a(not, a(divides, x))), xs)))
A(a(filter, f), a(a(cons, x), xs)) → A(if, a(f, x))

The TRS R consists of the following rules:

a(a(divides, 0), a(s, y)) → true
a(a(divides, a(s, x)), a(s, y)) → a(a(a(div2, x), a(s, y)), y)
a(a(a(div2, x), y), 0) → a(a(divides, x), y)
a(a(a(div2, 0), y), a(s, z)) → false
a(a(a(div2, a(s, x)), y), a(s, z)) → a(a(a(div2, x), y), z)
a(a(filter, f), nil) → nil
a(a(filter, f), a(a(cons, x), xs)) → a(a(a(if, a(f, x)), x), a(a(filter, f), xs))
a(a(a(if, true), x), xs) → a(a(cons, x), xs)
a(a(a(if, false), x), xs) → xs
a(a(not, f), x) → a(not2, a(f, x))
a(not2, true) → false
a(not2, false) → true
a(sieve, nil) → nil
a(sieve, a(a(cons, x), xs)) → a(a(cons, x), a(sieve, a(a(filter, a(not, a(divides, x))), xs)))

The set Q consists of the following terms:

a(a(divides, 0), a(s, x0))
a(a(divides, a(s, x0)), a(s, x1))
a(a(a(div2, x0), x1), 0)
a(a(a(div2, 0), x0), a(s, x1))
a(a(a(div2, a(s, x0)), x1), a(s, x2))
a(a(filter, x0), nil)
a(a(filter, x0), a(a(cons, x1), x2))
a(a(a(if, true), x0), x1)
a(a(a(if, false), x0), x1)
a(a(not, x0), x1)
a(not2, true)
a(not2, false)
a(sieve, nil)
a(sieve, a(a(cons, x0), x1))

We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 2 SCCs with 15 less nodes.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
QDP
                ↳ UsableRulesProof
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

A(a(a(div2, x), y), 0) → A(a(divides, x), y)
A(a(divides, a(s, x)), a(s, y)) → A(a(a(div2, x), a(s, y)), y)
A(a(a(div2, a(s, x)), y), a(s, z)) → A(a(a(div2, x), y), z)

The TRS R consists of the following rules:

a(a(divides, 0), a(s, y)) → true
a(a(divides, a(s, x)), a(s, y)) → a(a(a(div2, x), a(s, y)), y)
a(a(a(div2, x), y), 0) → a(a(divides, x), y)
a(a(a(div2, 0), y), a(s, z)) → false
a(a(a(div2, a(s, x)), y), a(s, z)) → a(a(a(div2, x), y), z)
a(a(filter, f), nil) → nil
a(a(filter, f), a(a(cons, x), xs)) → a(a(a(if, a(f, x)), x), a(a(filter, f), xs))
a(a(a(if, true), x), xs) → a(a(cons, x), xs)
a(a(a(if, false), x), xs) → xs
a(a(not, f), x) → a(not2, a(f, x))
a(not2, true) → false
a(not2, false) → true
a(sieve, nil) → nil
a(sieve, a(a(cons, x), xs)) → a(a(cons, x), a(sieve, a(a(filter, a(not, a(divides, x))), xs)))

The set Q consists of the following terms:

a(a(divides, 0), a(s, x0))
a(a(divides, a(s, x0)), a(s, x1))
a(a(a(div2, x0), x1), 0)
a(a(a(div2, 0), x0), a(s, x1))
a(a(a(div2, a(s, x0)), x1), a(s, x2))
a(a(filter, x0), nil)
a(a(filter, x0), a(a(cons, x1), x2))
a(a(a(if, true), x0), x1)
a(a(a(if, false), x0), x1)
a(a(not, x0), x1)
a(not2, true)
a(not2, false)
a(sieve, nil)
a(sieve, a(a(cons, x0), x1))

We have to consider all minimal (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
                ↳ UsableRulesProof
QDP
                    ↳ ATransformationProof
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

A(a(a(div2, x), y), 0) → A(a(divides, x), y)
A(a(divides, a(s, x)), a(s, y)) → A(a(a(div2, x), a(s, y)), y)
A(a(a(div2, a(s, x)), y), a(s, z)) → A(a(a(div2, x), y), z)

R is empty.
The set Q consists of the following terms:

a(a(divides, 0), a(s, x0))
a(a(divides, a(s, x0)), a(s, x1))
a(a(a(div2, x0), x1), 0)
a(a(a(div2, 0), x0), a(s, x1))
a(a(a(div2, a(s, x0)), x1), a(s, x2))
a(a(filter, x0), nil)
a(a(filter, x0), a(a(cons, x1), x2))
a(a(a(if, true), x0), x1)
a(a(a(if, false), x0), x1)
a(a(not, x0), x1)
a(not2, true)
a(not2, false)
a(sieve, nil)
a(sieve, a(a(cons, x0), x1))

We have to consider all minimal (P,Q,R)-chains.
We have applied the A-Transformation [17] to get from an applicative problem to a standard problem.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ ATransformationProof
QDP
                        ↳ QReductionProof
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

div21(s(x), y, s(z)) → div21(x, y, z)
divides1(s(x), s(y)) → div21(x, s(y), y)
div21(x, y, 0) → divides1(x, y)

R is empty.
The set Q consists of the following terms:

divides(0, s(x0))
divides(s(x0), s(x1))
div2(x0, x1, 0)
div2(0, x0, s(x1))
div2(s(x0), x1, s(x2))
filter(x0, nil)
filter(x0, cons(x1, x2))
if(true, x0, x1)
if(false, x0, x1)
not(x0, x1)
not2(true)
not2(false)
sieve(nil)
sieve(cons(x0, x1))

We have to consider all minimal (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

divides(0, s(x0))
divides(s(x0), s(x1))
div2(x0, x1, 0)
div2(0, x0, s(x1))
div2(s(x0), x1, s(x2))
filter(x0, nil)
filter(x0, cons(x1, x2))
if(true, x0, x1)
if(false, x0, x1)
not(x0, x1)
not2(true)
not2(false)
sieve(nil)
sieve(cons(x0, x1))



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ ATransformationProof
                      ↳ QDP
                        ↳ QReductionProof
QDP
                            ↳ QDPSizeChangeProof
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

divides1(s(x), s(y)) → div21(x, s(y), y)
div21(s(x), y, s(z)) → div21(x, y, z)
div21(x, y, 0) → divides1(x, y)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
QDP
                ↳ QDPApplicativeOrderProof

Q DP problem:
The TRS P consists of the following rules:

A(sieve, a(a(cons, x), xs)) → A(a(filter, a(not, a(divides, x))), xs)
A(a(filter, f), a(a(cons, x), xs)) → A(a(filter, f), xs)
A(a(not, f), x) → A(f, x)
A(a(filter, f), a(a(cons, x), xs)) → A(f, x)
A(sieve, a(a(cons, x), xs)) → A(sieve, a(a(filter, a(not, a(divides, x))), xs))

The TRS R consists of the following rules:

a(a(divides, 0), a(s, y)) → true
a(a(divides, a(s, x)), a(s, y)) → a(a(a(div2, x), a(s, y)), y)
a(a(a(div2, x), y), 0) → a(a(divides, x), y)
a(a(a(div2, 0), y), a(s, z)) → false
a(a(a(div2, a(s, x)), y), a(s, z)) → a(a(a(div2, x), y), z)
a(a(filter, f), nil) → nil
a(a(filter, f), a(a(cons, x), xs)) → a(a(a(if, a(f, x)), x), a(a(filter, f), xs))
a(a(a(if, true), x), xs) → a(a(cons, x), xs)
a(a(a(if, false), x), xs) → xs
a(a(not, f), x) → a(not2, a(f, x))
a(not2, true) → false
a(not2, false) → true
a(sieve, nil) → nil
a(sieve, a(a(cons, x), xs)) → a(a(cons, x), a(sieve, a(a(filter, a(not, a(divides, x))), xs)))

The set Q consists of the following terms:

a(a(divides, 0), a(s, x0))
a(a(divides, a(s, x0)), a(s, x1))
a(a(a(div2, x0), x1), 0)
a(a(a(div2, 0), x0), a(s, x1))
a(a(a(div2, a(s, x0)), x1), a(s, x2))
a(a(filter, x0), nil)
a(a(filter, x0), a(a(cons, x1), x2))
a(a(a(if, true), x0), x1)
a(a(a(if, false), x0), x1)
a(a(not, x0), x1)
a(not2, true)
a(not2, false)
a(sieve, nil)
a(sieve, a(a(cons, x0), x1))

We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].First, we preprocessed all pairs by applying the argument filter which replaces every head symbol by its second argument. Then we combined the reduction pair processor with the A-transformation [17] which results in the following intermediate Q-DP Problem.
The a-transformed P is

cons(x, xs) → xs
cons(x, xs) → xs
xx
cons(x, xs) → x
cons(x, xs) → filter(not(divides(x)), xs)

The a-transformed usable rules are

if(true, x, xs) → cons(x, xs)
filter(f, nil) → nil
if(false, x, xs) → xs
filter(f, cons(x, xs)) → if(notProper, x, filter(f, xs))


The following pairs can be oriented strictly and are deleted.


A(sieve, a(a(cons, x), xs)) → A(a(filter, a(not, a(divides, x))), xs)
A(a(filter, f), a(a(cons, x), xs)) → A(a(filter, f), xs)
A(a(filter, f), a(a(cons, x), xs)) → A(f, x)
The remaining pairs can at least be oriented weakly.

A(a(not, f), x) → A(f, x)
A(sieve, a(a(cons, x), xs)) → A(sieve, a(a(filter, a(not, a(divides, x))), xs))
Used ordering: Polynomial interpretation [25]:

POL(cons(x1, x2)) = 1 + x1 + x2   
POL(divides(x1)) = 1   
POL(false) = 0   
POL(filter(x1, x2)) = x1 + x2   
POL(if(x1, x2, x3)) = 1 + x2 + x3   
POL(nil) = 0   
POL(not(x1)) = x1   
POL(notProper) = 0   
POL(true) = 0   

The following usable rules [17] were oriented:

a(a(a(if, true), x), xs) → a(a(cons, x), xs)
a(a(filter, f), nil) → nil
a(a(a(if, false), x), xs) → xs
a(a(filter, f), a(a(cons, x), xs)) → a(a(a(if, a(f, x)), x), a(a(filter, f), xs))



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
                ↳ QDPApplicativeOrderProof
QDP
                    ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

A(a(not, f), x) → A(f, x)
A(sieve, a(a(cons, x), xs)) → A(sieve, a(a(filter, a(not, a(divides, x))), xs))

The TRS R consists of the following rules:

a(a(divides, 0), a(s, y)) → true
a(a(divides, a(s, x)), a(s, y)) → a(a(a(div2, x), a(s, y)), y)
a(a(a(div2, x), y), 0) → a(a(divides, x), y)
a(a(a(div2, 0), y), a(s, z)) → false
a(a(a(div2, a(s, x)), y), a(s, z)) → a(a(a(div2, x), y), z)
a(a(filter, f), nil) → nil
a(a(filter, f), a(a(cons, x), xs)) → a(a(a(if, a(f, x)), x), a(a(filter, f), xs))
a(a(a(if, true), x), xs) → a(a(cons, x), xs)
a(a(a(if, false), x), xs) → xs
a(a(not, f), x) → a(not2, a(f, x))
a(not2, true) → false
a(not2, false) → true
a(sieve, nil) → nil
a(sieve, a(a(cons, x), xs)) → a(a(cons, x), a(sieve, a(a(filter, a(not, a(divides, x))), xs)))

The set Q consists of the following terms:

a(a(divides, 0), a(s, x0))
a(a(divides, a(s, x0)), a(s, x1))
a(a(a(div2, x0), x1), 0)
a(a(a(div2, 0), x0), a(s, x1))
a(a(a(div2, a(s, x0)), x1), a(s, x2))
a(a(filter, x0), nil)
a(a(filter, x0), a(a(cons, x1), x2))
a(a(a(if, true), x0), x1)
a(a(a(if, false), x0), x1)
a(a(not, x0), x1)
a(not2, true)
a(not2, false)
a(sieve, nil)
a(sieve, a(a(cons, x0), x1))

We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 2 SCCs.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
                ↳ QDPApplicativeOrderProof
                  ↳ QDP
                    ↳ DependencyGraphProof
                      ↳ AND
QDP
                          ↳ QDPApplicativeOrderProof
                        ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

A(sieve, a(a(cons, x), xs)) → A(sieve, a(a(filter, a(not, a(divides, x))), xs))

The TRS R consists of the following rules:

a(a(divides, 0), a(s, y)) → true
a(a(divides, a(s, x)), a(s, y)) → a(a(a(div2, x), a(s, y)), y)
a(a(a(div2, x), y), 0) → a(a(divides, x), y)
a(a(a(div2, 0), y), a(s, z)) → false
a(a(a(div2, a(s, x)), y), a(s, z)) → a(a(a(div2, x), y), z)
a(a(filter, f), nil) → nil
a(a(filter, f), a(a(cons, x), xs)) → a(a(a(if, a(f, x)), x), a(a(filter, f), xs))
a(a(a(if, true), x), xs) → a(a(cons, x), xs)
a(a(a(if, false), x), xs) → xs
a(a(not, f), x) → a(not2, a(f, x))
a(not2, true) → false
a(not2, false) → true
a(sieve, nil) → nil
a(sieve, a(a(cons, x), xs)) → a(a(cons, x), a(sieve, a(a(filter, a(not, a(divides, x))), xs)))

The set Q consists of the following terms:

a(a(divides, 0), a(s, x0))
a(a(divides, a(s, x0)), a(s, x1))
a(a(a(div2, x0), x1), 0)
a(a(a(div2, 0), x0), a(s, x1))
a(a(a(div2, a(s, x0)), x1), a(s, x2))
a(a(filter, x0), nil)
a(a(filter, x0), a(a(cons, x1), x2))
a(a(a(if, true), x0), x1)
a(a(a(if, false), x0), x1)
a(a(not, x0), x1)
a(not2, true)
a(not2, false)
a(sieve, nil)
a(sieve, a(a(cons, x0), x1))

We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].Here, we combined the reduction pair processor with the A-transformation [17] which results in the following intermediate Q-DP Problem.
The a-transformed P is

sieve1(cons(x, xs)) → sieve1(filter(not(divides(x)), xs))

The a-transformed usable rules are

if(true, x, xs) → cons(x, xs)
filter(f, nil) → nil
if(false, x, xs) → xs
filter(f, cons(x, xs)) → if(notProper, x, filter(f, xs))


The following pairs can be oriented strictly and are deleted.


A(sieve, a(a(cons, x), xs)) → A(sieve, a(a(filter, a(not, a(divides, x))), xs))
The remaining pairs can at least be oriented weakly.
none
Used ordering: Polynomial interpretation [25]:

POL(cons(x1, x2)) = 1 + x2   
POL(divides(x1)) = 0   
POL(false) = 0   
POL(filter(x1, x2)) = x2   
POL(if(x1, x2, x3)) = 1 + x3   
POL(nil) = 0   
POL(not(x1)) = 0   
POL(notProper) = 0   
POL(sieve1(x1)) = x1   
POL(true) = 0   

The following usable rules [17] were oriented:

a(a(a(if, true), x), xs) → a(a(cons, x), xs)
a(a(filter, f), nil) → nil
a(a(a(if, false), x), xs) → xs
a(a(filter, f), a(a(cons, x), xs)) → a(a(a(if, a(f, x)), x), a(a(filter, f), xs))



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
                ↳ QDPApplicativeOrderProof
                  ↳ QDP
                    ↳ DependencyGraphProof
                      ↳ AND
                        ↳ QDP
                          ↳ QDPApplicativeOrderProof
QDP
                              ↳ PisEmptyProof
                        ↳ QDP

Q DP problem:
P is empty.
The TRS R consists of the following rules:

a(a(divides, 0), a(s, y)) → true
a(a(divides, a(s, x)), a(s, y)) → a(a(a(div2, x), a(s, y)), y)
a(a(a(div2, x), y), 0) → a(a(divides, x), y)
a(a(a(div2, 0), y), a(s, z)) → false
a(a(a(div2, a(s, x)), y), a(s, z)) → a(a(a(div2, x), y), z)
a(a(filter, f), nil) → nil
a(a(filter, f), a(a(cons, x), xs)) → a(a(a(if, a(f, x)), x), a(a(filter, f), xs))
a(a(a(if, true), x), xs) → a(a(cons, x), xs)
a(a(a(if, false), x), xs) → xs
a(a(not, f), x) → a(not2, a(f, x))
a(not2, true) → false
a(not2, false) → true
a(sieve, nil) → nil
a(sieve, a(a(cons, x), xs)) → a(a(cons, x), a(sieve, a(a(filter, a(not, a(divides, x))), xs)))

The set Q consists of the following terms:

a(a(divides, 0), a(s, x0))
a(a(divides, a(s, x0)), a(s, x1))
a(a(a(div2, x0), x1), 0)
a(a(a(div2, 0), x0), a(s, x1))
a(a(a(div2, a(s, x0)), x1), a(s, x2))
a(a(filter, x0), nil)
a(a(filter, x0), a(a(cons, x1), x2))
a(a(a(if, true), x0), x1)
a(a(a(if, false), x0), x1)
a(a(not, x0), x1)
a(not2, true)
a(not2, false)
a(sieve, nil)
a(sieve, a(a(cons, x0), x1))

We have to consider all minimal (P,Q,R)-chains.
The TRS P is empty. Hence, there is no (P,Q,R) chain.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
                ↳ QDPApplicativeOrderProof
                  ↳ QDP
                    ↳ DependencyGraphProof
                      ↳ AND
                        ↳ QDP
QDP
                          ↳ UsableRulesProof

Q DP problem:
The TRS P consists of the following rules:

A(a(not, f), x) → A(f, x)

The TRS R consists of the following rules:

a(a(divides, 0), a(s, y)) → true
a(a(divides, a(s, x)), a(s, y)) → a(a(a(div2, x), a(s, y)), y)
a(a(a(div2, x), y), 0) → a(a(divides, x), y)
a(a(a(div2, 0), y), a(s, z)) → false
a(a(a(div2, a(s, x)), y), a(s, z)) → a(a(a(div2, x), y), z)
a(a(filter, f), nil) → nil
a(a(filter, f), a(a(cons, x), xs)) → a(a(a(if, a(f, x)), x), a(a(filter, f), xs))
a(a(a(if, true), x), xs) → a(a(cons, x), xs)
a(a(a(if, false), x), xs) → xs
a(a(not, f), x) → a(not2, a(f, x))
a(not2, true) → false
a(not2, false) → true
a(sieve, nil) → nil
a(sieve, a(a(cons, x), xs)) → a(a(cons, x), a(sieve, a(a(filter, a(not, a(divides, x))), xs)))

The set Q consists of the following terms:

a(a(divides, 0), a(s, x0))
a(a(divides, a(s, x0)), a(s, x1))
a(a(a(div2, x0), x1), 0)
a(a(a(div2, 0), x0), a(s, x1))
a(a(a(div2, a(s, x0)), x1), a(s, x2))
a(a(filter, x0), nil)
a(a(filter, x0), a(a(cons, x1), x2))
a(a(a(if, true), x0), x1)
a(a(a(if, false), x0), x1)
a(a(not, x0), x1)
a(not2, true)
a(not2, false)
a(sieve, nil)
a(sieve, a(a(cons, x0), x1))

We have to consider all minimal (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
                ↳ QDPApplicativeOrderProof
                  ↳ QDP
                    ↳ DependencyGraphProof
                      ↳ AND
                        ↳ QDP
                        ↳ QDP
                          ↳ UsableRulesProof
QDP
                              ↳ QDPSizeChangeProof

Q DP problem:
The TRS P consists of the following rules:

A(a(not, f), x) → A(f, x)

R is empty.
The set Q consists of the following terms:

a(a(divides, 0), a(s, x0))
a(a(divides, a(s, x0)), a(s, x1))
a(a(a(div2, x0), x1), 0)
a(a(a(div2, 0), x0), a(s, x1))
a(a(a(div2, a(s, x0)), x1), a(s, x2))
a(a(filter, x0), nil)
a(a(filter, x0), a(a(cons, x1), x2))
a(a(a(if, true), x0), x1)
a(a(a(if, false), x0), x1)
a(a(not, x0), x1)
a(not2, true)
a(not2, false)
a(sieve, nil)
a(sieve, a(a(cons, x0), x1))

We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs: